﻿<Window x:Class="CECB.Activity.Project_Activity_Window"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"
      
        Title="Project_Questions_Window" 
        
          WindowStartupLocation="CenterScreen"   Background="#AA000000" 
        AllowsTransparency="True" WindowStyle="None" WindowState="Maximized"
        mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"   Loaded="Window_Loaded">


    <Window.Resources>
        <Storyboard x:Key="drop">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="groupBox">
                <EasingDoubleKeyFrame KeyTime="0" Value="0.02"/>
                <EasingDoubleKeyFrame KeyTime="0:0:1" Value="1.194">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <BackEase EasingMode="EaseOut" Amplitude="-3"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="groupBox">
                <EasingDoubleKeyFrame KeyTime="0" Value="-120"/>
                <EasingDoubleKeyFrame KeyTime="0:0:1" Value="23.75">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <BackEase EasingMode="EaseOut" Amplitude="-3"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </Window.Resources>
    <Grid Margin="100,140,0,0">

        <Rectangle Margin="10,0,0,0" Width="920" Height="550" VerticalAlignment="Top" HorizontalAlignment="Left" Stroke="White" RadiusY="19.5" RadiusX="19.5" StrokeThickness="4">
            <Rectangle.Effect>
                <DropShadowEffect Direction="330" BlurRadius="24" ShadowDepth="13" />
            </Rectangle.Effect>
            <Rectangle.Fill>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="Black" Offset="0" />
                    <GradientStop Color="#FFA3A1A1" Offset="0.494" />
                    <GradientStop Color="#FF272121" Offset="0" />
                    <GradientStop Color="#FF272121" Offset="1" />
                </LinearGradientBrush>
            </Rectangle.Fill>
        </Rectangle>


        <Grid Margin="10,6,0,0" >
            <Grid.RowDefinitions>
                <RowDefinition Height="53*" />
                <RowDefinition Height="408*" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="40" />
                <ColumnDefinition Width="560" />
                <ColumnDefinition Width="300" />
            </Grid.ColumnDefinitions>
            <TextBlock Height="55" HorizontalAlignment="Left" Grid.ColumnSpan="3" Margin="45,0,0,0" Name="textBlock1" Text=" Project Activities" VerticalAlignment="Top" FontSize="35" Foreground="White" FontStyle="Italic" FontWeight="ExtraBold" Width="auto" />

            <StackPanel Grid.Column="1" Grid.Row="1" Height="auto" HorizontalAlignment="Left" Name="stackPanel1" VerticalAlignment="Top" Width="544" Orientation="Vertical" Margin="0,10,0,0">
                <WrapPanel Orientation="Horizontal" Height="32">
                    <TextBlock Height="35" Name="textBlock2" Text="   Select a project"   FontSize="20" Foreground="White"  Width="200" />
                    <toolkit:AutoCompleteBox Name="ProjectAutocompleteTextBox"  Width="270" Margin="60,0,0,0" Height="30"  ValueMemberPath="proj_name"  FilterMode="Contains"  ItemsSource="{Binding}"  TabIndex="1" IsTabStop="True"  SelectionChanged="ProjectAutocomplete_SelectionChanged" FontSize="18" Background="White" Opacity="1" HorizontalAlignment="Center" UseLayoutRounding="False" BorderBrush="#FFF8F8F8" BorderThickness="2">
                        <toolkit:AutoCompleteBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="{Binding Path=proj_reference}"/>
                                    <TextBlock Text=" - "/>
                                    <TextBlock Text="{Binding Path=proj_name}"/>
                                </StackPanel>
                            </DataTemplate>
                        </toolkit:AutoCompleteBox.ItemTemplate>
                    </toolkit:AutoCompleteBox>
                </WrapPanel>
                <!--<WrapPanel Name="ProjectDetailsWrapPanel" Orientation="Vertical" Height="auto">
                <WrapPanel Height="32">
                    <TextBlock Height="25" Name="textBlock3" Text="Project Reference"   FontSize="20" Foreground="White"  Width="200" />
                    <Label Content="{Binding Path=proj_reference}" Height="32" FontSize="14" Name="labelProjectReference" Margin="50,0,0,0" Width="auto" VerticalAlignment="Top"  />
                </WrapPanel>
                <WrapPanel Height="32">
                    <TextBlock Height="25" Name="textBlock4" Text="Project Name"   FontSize="20" Foreground="White"  Width="200" />
                    <Label Content="{Binding Path=proj_name}" Height="32" FontSize="14" Name="label5" Margin="50,0,0,0" Width="auto" VerticalAlignment="Top"  />
                </WrapPanel>
                <WrapPanel Height="32">
                    <TextBlock Height="25" Name="textBlock6" Text="Project Team"   FontSize="20" Foreground="White"  Width="200" />
                    <Label Content="{Binding Path=proj_team}" Height="32" FontSize="14" Name="label6" Margin="50,0,0,0" Width="auto" VerticalAlignment="Top"  />
                </WrapPanel>
                <WrapPanel Height="32">
                    <TextBlock Height="25" Name="textBlock5" Text="Project Category"   FontSize="20" Foreground="White"  Width="200" />
                    <Label Content="{Binding Path=proj_subCategory}" Height="32" FontSize="14" Name="label3" Margin="50,0,0,0" Width="auto" VerticalAlignment="Top"  />
                </WrapPanel>

            </WrapPanel>-->
                <WrapPanel Name="ProjectDetailsWrapPanel" Margin="0,0,0,0" Orientation="Vertical" Height="auto" Background="DimGray" OpacityMask="{x:Null}">
                    <WrapPanel Height="32" Margin="10,0,0,0">
                        <TextBlock Height="29" Name="textBlock3" Text="Project Reference: "    TextAlignment="Right"   FontSize="16" Foreground="White"  Width="240"  Background="#FF3E3832" VerticalAlignment="Stretch" />
                        <Label Content="{Binding Path=proj_reference}" Height="29" FontSize="14" Foreground="#FF3E3832" Name="labelProjectReference" Margin="10,0,0,0" Width="270" VerticalAlignment="Top" Background="#FFF0F0F0"  BorderBrush="#FFB4B4B4" BorderThickness="1" />
                    </WrapPanel>
                    <WrapPanel Height="32"  Margin="10,0,0,0"  >
                        <TextBlock Height="29" Name="textBlock4" Text="Project Name: " TextAlignment="Right"  FontSize="16" Foreground="White"  Width="240" Background="#FF3E3832" VerticalAlignment="Stretch" />
                        <Label Content="{Binding Path=proj_name}" Height="29" FontSize="14" Foreground="#FF3E3832" Name="label5" Margin="10,0,0,0" Width="270" VerticalAlignment="Top"  Background="#FFF0F0F0" BorderBrush="#FFB4B4B4" BorderThickness="1" />
                    </WrapPanel>
                    <WrapPanel Height="32"  Margin="10,0,0,0"  >
                        <TextBlock Height="29" Name="textBlock6" Text="Project Team: "  TextAlignment="Right" FontSize="16" Foreground="White"  Width="240" Background="#FF3E3832" VerticalAlignment="Stretch" />
                        <Label Content="{Binding Path=proj_consultant}" Height="29" FontSize="14" Foreground="#FF3E3832" Name="label6" Margin="10,0,0,0" Width="270" VerticalAlignment="Top" Background="#FFF0F0F0" BorderBrush="#FFB4B4B4" BorderThickness="1" />
                    </WrapPanel>
                    <WrapPanel Height="32"  Margin="10,0,0,0"  >
                        <TextBlock Height="29" Name="textBlock5" Text="Project Category: " TextAlignment="Right"  FontSize="16" Foreground="White"  Width="240" Background="#FF3E3832" VerticalAlignment="Stretch" />
                        <Label Content="{Binding Path=ProjectTypes.ptype_name}" Height="29" FontSize="14" Foreground="#FF3E3832" Name="label3" Margin="10,0,0,0" Width="270" VerticalAlignment="Top" Background="#FFF0F0F0" BorderBrush="#FFB4B4B4" BorderThickness="1" />
                    </WrapPanel>
                </WrapPanel>
                <WrapPanel Name="AddQs" Margin="0,20,0,0" Orientation="Vertical" Height="287">
                    <WrapPanel Background="#FF3E3832">
                        <TextBlock Height="25" Name="textBlock23" Text="Select Phase: "   FontSize="18" Foreground="White"  Width="250" TextAlignment="Right" />
                        <ComboBox Height="23" Name="comboBoxComponents" Width="269" Margin="10,0,0,0" Background="#FFFFE8A6">
                            <ComboBoxItem Content="Preconstriction &amp; Mobilization" />
                            <ComboBoxItem Content="Constriction Phase" />
                            <ComboBoxItem Content="Operation &amp; Maintenance Phase" />
                        </ComboBox>
                    </WrapPanel>
                    <WrapPanel Background="#FF3E3832">
                        <TextBlock Height="25" Name="textBlock32" Text="Add New Activity: "   FontSize="18" Foreground="White"  Width="250" TextAlignment="Right" />
                        <TextBox Height="25" Name="textBoxAddActivity"  FontSize="14" Foreground="Black"  Width="230"  Margin="10,0,0,0" TextChanged="textBoxAddActivity_TextChanged" SelectionChanged="textBoxAddActivity_SelectionChanged" Background="#FFF0F0F0" />
                        <Button Content="Add" Height="23" Name="button1" Width="40" Click="button1_Click" Background="#FF3E3832" Foreground="#FFFFF8F8" BorderBrush="White" BorderThickness="2" />
                    </WrapPanel>
                    <WrapPanel>
                        <TextBlock Height="25" Name="textBlock12" Text="Phases and activities"   FontSize="18" Foreground="White"   Width="200" TextAlignment="Right" />
                    </WrapPanel>
                    <WrapPanel>
                        <!--<ListView Grid.Row="1" Name="listViewQuestions" ItemsSource="{Binding}" Margin="1" MaxHeight="150" Height="150" >
                        <ListView.View>
                            <GridView x:Name="questionsGridView">
                                <GridViewColumn Header="Phase"  Width="150"  DisplayMemberBinding="{Binding Col1}" />
                                <GridViewColumn Header="Activity"  Width="330"  DisplayMemberBinding="{Binding Col2}" />                                
                            </GridView>
                        </ListView.View>
                    </ListView>-->

                        <DataGrid  ItemsSource="{Binding ModelListe}" AutoGenerateColumns="False" Background="#FFF0F0F0" Height="150" HorizontalAlignment="Left" Margin="0,0,0,0" Name="dataGrid1" VerticalAlignment="Top" Width="550" BorderThickness="0" CanUserDeleteRows="True" CanUserResizeColumns="False" CanUserResizeRows="False" CanUserSortColumns="False" CanUserReorderColumns="False" ColumnHeaderHeight="30"  IsReadOnly="True" MinHeight="25" RowBackground="#FFBEBBBB" SelectionMode="Single" VerticalGridLinesBrush="#FF3E3832" FontSize="14" HorizontalContentAlignment="Center">
                            <DataGrid.Columns>
                                <DataGridTextColumn Binding="{Binding actv_phase}" CanUserReorder="False" Header="Component" Width="200" />
                                <DataGridTextColumn Binding="{Binding actv_name}" CanUserReorder="False" Header="Question" Width="300" />
                            </DataGrid.Columns>
                        </DataGrid>
                    </WrapPanel>
                    <WrapPanel Orientation="Horizontal" Width="554">

                        <StackPanel Name="stackPanel14" Orientation="Horizontal" Margin="340,0,0,0" HorizontalAlignment="Right" Width="auto">


                            <Button Background="{x:Null}" BorderBrush="White" Click="SaveButton_Click" Height="44" Margin="2,0" Name="SaveButton" Width="98">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="*" />
                                    </Grid.ColumnDefinitions>
                                    <Image Grid.Column="0" Height="32" Margin="2" Source="/CECB;component/images/Save.png" Width="32" />
                                    <StackPanel Grid.Column="1" HorizontalAlignment="Stretch" Margin="2" VerticalAlignment="Center">
                                        <TextBlock Margin="0" Padding="0" Foreground="White" Text="Save" TextWrapping="NoWrap" />
                                    </StackPanel>
                                </Grid>
                            </Button>
                            <Button Background="{x:Null}" BorderBrush="White" Click="CloseButton_Click" Height="44" Margin="2,0" Name="CloseButton" Width="98">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="*" />
                                    </Grid.ColumnDefinitions>
                                    <Image Grid.Column="0" Height="32" Margin="2" Source="/CECB;component/images\close.png" Width="32" />
                                    <StackPanel Grid.Column="1" HorizontalAlignment="Stretch" Margin="2" VerticalAlignment="Center">
                                        <TextBlock Margin="0" Padding="0" Foreground="White" Text="Remove" TextWrapping="NoWrap" />
                                    </StackPanel>
                                </Grid>
                            </Button>
                        </StackPanel>


                    </WrapPanel>

                </WrapPanel>
            </StackPanel>
            <StackPanel Grid.Column="2" Grid.Row="1" Height="406" Name="stackPanel2" VerticalAlignment="Top" Orientation="Vertical" >
                <WrapPanel Orientation="Vertical" >

                   
                    <TextBlock Height="25" Name="ads" Text="Add Existing Activity: " HorizontalAlignment="Left"  FontSize="18" Foreground="White"  Width="177" TextAlignment="Right" />
                    <TextBox Grid.Column="2"   Width="300" Margin="6,10,0,0" Height="30" Name="textBoxActivitySearch" VerticalAlignment="Top" FontSize="18" Background="White" Opacity="1" HorizontalAlignment="Center" TextChanged="textBoxActivitySearch_TextChanged" />

                </WrapPanel>

                <GroupBox x:Name="groupBox" Margin="0,0,0,0" BorderThickness="0" MaxHeight="320">
                    <GroupBox.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform/>
                            <SkewTransform/>
                            <RotateTransform/>
                            <TranslateTransform/>
                        </TransformGroup>
                    </GroupBox.RenderTransform>
                    <WrapPanel MaxWidth="350" Margin=" 0,0,0,0">
                        <ListBox x:Name="listBoxActivities" ScrollViewer.CanContentScroll="False" ScrollViewer.VerticalScrollBarVisibility="Hidden" ScrollViewer.HorizontalScrollBarVisibility="Hidden" Height="320" Background="DimGray" Width="auto" SelectionChanged="listBoxActivities_SelectionChanged">
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <WrapPanel Background="#FF3E3832" MaxWidth="300">
                                        <StackPanel Orientation="Horizontal" MaxWidth="300">
                                            <!--<CheckBox IsChecked="{Binding Deleteable, Mode=TwoWay}" Name="CheckBoxActivity" VerticalAlignment="Center" HorizontalAlignment="Left"  />-->
                                            <WrapPanel Orientation="Vertical" MaxWidth="300">
                                                <Label Content="{Binding actv_name}" Height="30" Width="300" Foreground="White"   HorizontalAlignment="Left" FontSize="15" />
                                                <Label Content="{Binding actv_phase}" Height="22" Width="300" Foreground="White"   HorizontalAlignment="Right" FontSize="10" />
                                            </WrapPanel>
                                        </StackPanel>
                                    </WrapPanel>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>
                    </WrapPanel>
                </GroupBox>


            </StackPanel>
        </Grid>

        <Grid HorizontalAlignment="Left" VerticalAlignment="Top" Margin="876,12,0,0">
            <Image Height="32" Margin="2" Source="/CECB;component/images/closeblack.png"  Width="32" MouseLeftButtonDown="Image_MouseLeftButtonDown" />
        </Grid>

    </Grid>
</Window>
